package com.electric.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Service;

import com.electric.service.IRepairTypeService;

@Service
public class StartGateServiceData implements ApplicationListener<ContextRefreshedEvent>,LoggerInterface {
	@Autowired
	private IRepairTypeService repairTypeService;

	@Override
	public void onApplicationEvent(ContextRefreshedEvent event) {
		try {
			// 从数据库加载故障类型到Contains中的map下
			repairTypeService.loadRepairTypeToContainsMap();
			logger.debug("成功从数据库加载故障类型到Contains中的map下");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
